﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListUsers.aspx.cs" Inherits="Torch.WL.Web.Admin.Modubles.ListUsers" %>

<%@ Import Namespace="Torch.FrameWork.Langeuages" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>
        <%=ResourceManager.GetString("ListUsers_Title_Name")%></title>
    <link href="../../../Inc/Style/<%=Request.Cookies["UIStyle"].Value%>/css/indexControl.css"
        rel="stylesheet" type="text/css" />

    <script src="../../../Inc/Script/pub.js" type="text/javascript"></script>

    <link href="../../../resources/css/Framework.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
         function $id(s) {
             return document.getElementById(s);
         }
        //新增数据合法性检测
        function Btn_Search() {
            var ret = true;

            if ($id("txt_name").value == "") {
                //alert('请输入用户名');
                //ret = false;
            }
           
            return ret;
        }
        
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="divToolBar" class="topBar">
        <div class="toolBar">
        </div>
        <div class="moduleName">
            <%=ResourceManager.GetString("ListUsers_Title_Name")%></div>
    </div>
    <div class="w_wrapper w_marginTop">
        <div class="w_header">
            <div class="w_inputArea">
                &nbsp;&nbsp;&nbsp;名称：
                <asp:DropDownList ID="GroupList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="GroupList_SelectedIndexChanged">
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp; 用户名：
                <asp:TextBox ID="txt_name" CssClass="w_text" runat="server"></asp:TextBox>
                <asp:Button ID="btn_search" CssClass="w_button" runat="server" Text="查找" OnClick="btn_search_Click" />
                <input type="button" class="w_button" value="新建" onclick="window.location.href='EditUserPage.aspx';" />
            </div>
            <div id="strinfo" runat="server" class="w_info" visible="false">
            </div>
        </div>
        <div class="w_block">
        </div>
        <div class="w_content">
            <asp:GridView ID="UserList" runat="server" DataKeyNames="UserID" CssClass="w_table"
                OnRowCommand="UserList_RowCommand" OnRowDataBound="UserList_RowDataBound" PageSize="15"
                AutoGenerateColumns="False" AllowPaging="True" OnPageIndexChanging="UserList_PageIndexChanging" GridLines="None" >
                <Columns>
                    <asp:BoundField DataField="UserID" HeaderText="编号" ReadOnly="True" >
                        <ItemStyle HorizontalAlign="Left" Wrap="False"  />
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" Width="50px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="登录名">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("UserName") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="用户名" Visible="false">
                        <ItemTemplate>
                            <%# Eval("DomainName") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="显示名">
                        <ItemTemplate>
                            <%# Eval("ShowName") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="用户角色">
                        <ItemTemplate>
                            <asp:Label ID="Lab_RoleName" runat="server" Text=""></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                        <ItemStyle HorizontalAlign="Left" Wrap="False" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="用户组" Visible="False">
                        <ItemTemplate>
                            <asp:Label ID="Lab_GroupName" runat="server" Text='<%# Eval("UG_Name") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态" Visible="False">
                        <ItemTemplate>
                            <asp:Label ID="Lab_state" runat="server" Text='<%# Eval("Status") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="创建时间" DataField="CreateTime" DataFormatString="{0:yyyy-MM-dd HH:mm:ss}">
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="最后登录时间" DataField="LastLoginTime" DataFormatString="{0:yyyy-MM-dd HH:mm:ss}">
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="授权" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="btn_grant" runat="server" CausesValidation="False" CommandName="Grant"
                                Text="授权" CommandArgument='<%# Eval("UserID").ToString()+","+Eval("UserName").ToString()%>'></asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" Width="50px" />
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="查看" ShowHeader="False">
                        <ItemTemplate>
                            <asp:HyperLink ID="link_view" runat="server" NavigateUrl='<%# Eval("UserID", "EditUserPage.aspx?uid={0}") %>'
                                Text="查看详情"></asp:HyperLink>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" Width="60px"/>
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="删除" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="btn_del" runat="server" CausesValidation="False" CommandName="Del"
                                Text="删除" CommandArgument='<%# Eval("UserID")%>'></asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Wrap="False" Width="60px"/>
                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="header" />
                <AlternatingRowStyle CssClass="w_trEven" />
            </asp:GridView>
            <div id="GridViewMsg" style="padding: 5px;" runat="server">
            </div>
        </div>
    </div>
    </form>
</body>
</html>
